enum Gender {
    girl,
    boy
}

{
    type Point = { x: number; y: number };
    type P = keyof {a:1,b:2};

let p1:P = 'x'
}


type User = {
   name: string,
   gender: Gender
}

const u1: User = {
   name: '小花',
   gender: Gender.girl // 写代码的时候，可以利用代码提示
}

const u2: User = {
    name: '小白',
    gender: Gender.boy
}

console.log(u2) // ? {name: '小白', gender: 1}